#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define ll long long
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
using namespace std;
const int N = 2005,V = 150,B = 2520,mod = 998244353;
int n;
ll ans[N],inv[B+5];
struct node
{
    int len,a[V];ll p;
    void up()
    {
        p = 0;
        for(int i = 0;i < len;i++)p += a[i];
        p = p*inv[len]%mod;
    }
    friend void operator += (node &x,const node &y)
    {for(int i = 0;i < x.len;i++)x.a[i] *= y.a[i%y.len];}
}a[N],f[N],tmp;
int gcd(int x,int y){return y?gcd(y,x%y):x;}
void solve(int d)
{
    for(int i = 1;i <= V;i++)f[i].len = 0;
    for(int i = 1;i <= n;i++)
    {
        int m = tmp.len = a[i].len/gcd(a[i].len,B);
        for(int j = 0;j < tmp.len;j++)
            tmp.a[j] = a[i].a[(d+j*B)%a[i].len];
        bool flag = 0;
        for(int j = m;j <= V;j += m)
            if(f[j].len){f[j] += tmp;f[j].up();flag = 1;break;}
        if(!flag)
        {
            f[m] = tmp;
            for(int j = 1;j < m;j++)
                if(m%j == 0&&f[j].len)f[m] += f[j],f[j].len = 0;
            f[m].up();
        }
        ll sum = 1;
        for(int j = 1;j <= V;j++)
            if(f[j].len)(sum *= f[j].p) %= mod;
        (ans[i] += sum) %= mod;
    }
}
char buf[1<<21],*p1,*p2;
inline int rd()
{
    char c;int f = 1;
    while(!isdigit(c = getchar()))if(c=='-')f = -1;
    int x = c-'0';
    while(isdigit(c = getchar()))x = x*10+(c^48);
    return x*f;
}
int main()
{
    freopen("traffic.in","r",stdin);
    freopen("traffic.out","w",stdout);
    n = rd();inv[1] = 1;
    for(int i = 2;i <= B;i++)inv[i] = (mod-mod/i)*inv[mod%i]%mod;
    for(int i = 1;i <= n;i++)
    {
        int x = rd(),r = rd(),g = rd();
        int m = a[i].len = r+g;
        for(int p = (r-x%m+m)%m,t = g;t--;p = (p+1)%m)a[i].a[p] = 1;
    }
    for(int d = 0;d < B;d++)solve(d);
    ans[0] = 1;
    for(int i = 1;i <= n;i++)(ans[i] *= inv[B]) %= mod;
    for(int i = 0;i <= n;i++)
        printf("%lld\n",(ans[i]-ans[i+1]+mod)%mod);
    return 0;
}